#include <iostream>
#include <string>
#include "PL5_worker.h"

using std::cout;
using std::endl;
using std::cin;
using std::string;
int main(int argc, char const *argv[])
{

    Stack<string> stk(5);
    stk.show();
    for (int i = 0; i < 5; i++)
    {
        string s;
        cin >> s;
        stk.push(s);
    }
    stk.show();
    for (int i = 0; i < 5; i++)
    {
        string s;
        stk.pop(s);
        cout << s << endl;
    }
    stk.show();
    return 0;
}
